package se19team1e.entity;

import se19team1e.dao.abstrakt.generics.DataTransferObject;
import se19team1e.util.ReflectionUtils;

/**
 * Represents a department of a company in the system. It should exist as part
 * of a company. Company ID is part of the field and used to validate that a
 * department exists as part of a company.
 * 
 * @author Nasri Bin Najib
 * 
 */
@SuppressWarnings("serial")
public class DepartmentDTO implements DataTransferObject<DepartmentDTO> {

	/**
	 * Department object id.
	 */
	private String id;

	/**
	 * Department name.
	 */
	private String name;

	/**
	 * Department company id.
	 */
	private String companyId;
	/**
	 * Indicates if this department is marked as deleted
	 */
	private boolean deleted;

	/**
	 * Sets the new department object id.
	 * 
	 * @param id
	 *            New department object id.
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * Gets the Department full name.
	 * 
	 * @return Department full name.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the new Department full name.
	 * 
	 * @param name
	 *            New Department full name.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Gets the Department company id.
	 * 
	 * @return Department company id.
	 */
	public String getCompanyId() {
		return companyId;
	}

	/**
	 * Sets the new Department company id.
	 * 
	 * @param companyId
	 *            New Department company id.
	 */
	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	/**
	 * Method to set the department DTO as deleted
	 */
	@Override
	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	/**
	 * A Flag to indicate that a department DTO is deleted
	 */
	@Override
	public boolean isDeleted() {
		return deleted;
	}

	/**
	 * Set the ID for the department DTO
	 */
	@Override
	public void setId(Object id) {
		this.id = (String) id;
	}

	/**
	 * Get the ID for the department DTO
	 * 
	 * @return A string with the ID of department DTO
	 */
	@Override
	public String getId() {
		return id;
	}

	/**
	 * Method for department DTO
	 * 
	 * @return String that has the fields of the department DTO
	 */
	@Override
	public String toString() {
		return (ReflectionUtils.toString(this));
	}
}
